﻿<%@ WebHandler Language="VB" Class="capimg" %>

Imports System
Imports System.Web

Public Class capimg : Implements IHttpHandler
    
    Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
        'context.Response.ContentType = "text/plain"
        'context.Response.Write("Hello World")
        Dim str As String = context.Request("str")
        Dim img As New Captcha(str, 200, 40)
        context.Response.ContentType = "image/png"
        img.Image.Save(context.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Png)

    End Sub
 
    Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
        Get
            Return False
        End Get
    End Property

End Class